package com.notes.service.implement;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.notes.dao.ItemDao;
import com.notes.model.Item;
import com.notes.model.SelectItemData;
import com.notes.service.ItemService;
@Transactional
@Service
public class ItemServiceImplement implements ItemService {
	@Autowired
	private ItemDao itemDao;
	@Override
	public void addItem(String text, Long userId,Date remindTime) {
		
		itemDao.addItem(text,userId,remindTime);
		
	}
	
	@Override
	public void itemDelete(Long userId, List<SelectItemData> selectedList) {
		itemDao.itemDelete(userId,selectedList);
		
	}
	
	@Override
	public void itemDone(Long userId, List<SelectItemData> selectedItemSet) {
		itemDao.itemDone(userId,selectedItemSet);
		
	}

	public ItemDao getItemDao() {
		return itemDao;
	}

	public void setItemDao(ItemDao itemDao) {
		this.itemDao = itemDao;
	}

	@Override
	public List<Item> itemDoneHistory(Long userId) {
		return itemDao.itemDoneHistory(userId);		
	}



	@Override
	public List<Item> getItemListByUserId(Long userId) {
		return itemDao.getItemListByUserId(userId);
	}
}
